<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


use App\Models\Friend;
use App\Models\UserDrawLotsLog;
use Carbon\Carbon;
use Creativeorange\Gravatar\Facades\Gravatar;

Route::get('/', function () {
    return 'success';
});

Route::get('9s23REs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');

Route::group(['prefix'=>'test'],function(){
    Route::get('delete-user-friends/{user_id}',function($user_id){
        $friends = Friend::where('user_id',$user_id)->get();
        Friend::where('user_id',$user_id)->delete();
        return $friends;
    });
    
    Route::get('clear-user-today-sign/{user_id}',function($user_id){
        UserDrawLotsLog::where('user_id',$user_id)->update(['created_at'=>Carbon::yesterday()->toDateTimeString()]);
    });
    
});